import { IFeidaoAiWeappPage } from '@feidao/web/interfaces';
import client_login from '@feidao/web/atom/wx/app/msg/user-login';
import { login } from '../atom-wx-app/config';
// import login from '@feidao/web/atom/wx/app/api/interface/login';
// import selector from '@feidao/web/atom/wx/app/api/xml/create';
// import select from '@feidao/web/atom/wx/app/api/xml/select';

export default async function a001(fd: IFeidaoAiWeappPage, ...args: any[]) {
	// todo
	// const res = await login();
	// const code = res.code;
	// // 获取openid
	// // GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code

	// const url = 'https://api.weixin.qq.com/sns/jscode2session?appid=wx76be1f60d92a519e&secret=0035eb03939b11af84954f67c4358c99&js_code=' + code + '&grant_type=authorization_code';
	// debugger
	// const query = selector();
	// const node = select(query, '[data-feidao-id="url"]');
	// node.value = url;
	await client_login(login, 'admin', '111111');
}
